package com.itheima.mapper.role;

import com.itheima.domain.Role;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;

import java.util.List;


public interface RoleMapper {
    //查询所有角色管理信息
    List<Role> list();

    //新增
    void save(Role role);

    //根据勾选Id删除
    void delete(String[] id);

    //根据ID查询
    List<Role> findById(String id);

    @Insert("insert into role_permission values (#{pid}, #{rid})")
    void savePermission(@Param("pid") String pid, @Param("rid") String rid);

    @Delete("delete from role_permission where roleId=#{id}")
    void deletePermission(String id);
}
